<?php
/**
 * Created by PhpStorm.
 * User: mars
 * Date: 2018/11/27
 * Time: 5:42 PM
 */
use yii\bootstrap\ActiveForm;
$this->title = "老彭今天吃了什么"
?>
<?//=var_dump($records)?>
<div class="content-wrap">
    <div class="row">
        <?php foreach ($records as$record):?>

            <div class="item" id="i_<?=$record['id']?>">
                <div class="des">
                    <p style="margin:0px;">
                        <?=$record['content']?>
                    </p>
                </div>
                <div class="time pull-right">
                    <span style="color: #aaa;padding-left:10px;">
                        <span class="delete"  onclick="actionDelete(<?='\''.$record['id'].'\''?>,<?='\''.\yii\helpers\Url::to(['food/delete'],true).'\''?>)">x</span>
                        <?=date('H:i:s',$record['created_at'])?>
                    </span>
                </div>
            </div>
        <?php endforeach;?>
    </div>
    <div class="form">
        <?php $form=ActiveForm::begin([
            'fieldConfig' => [
                'template' => "{beginWrapper}\n{input}\n{hint}\n{error}\n{endWrapper}",
            ],
            'action'=>\yii\helpers\Url::toRoute(['food/save']),
        ])?>
        <div class="col-sm-10 pull-left"style="width: 75%">
            <?=$form->field($model,'content')->input('text')?>
        </div>
        <div class="col-sm-3 pull-right " style="">
            <?=\yii\bootstrap\Html::submitButton('添加',['class'=>'btn btn-success  pull-right'])?>
        </div>
        <?php $form=ActiveForm::end()?>
    </div>
</div>

